<!DOCTYPE html>
<html>
  <head>
    <meta charset="utf-8">
    <title></title>
    <script src="jquery.js" charset="utf-8"></script>
    <script>
    $(function (){
      $('#btn1').click(function (){
        $.ajax({
          url: '1.php',
          data: {a: 12, b: 5},
          type: 'get',
          dataType: 'text',
          success(str){
            alert(str);
          },
          error(){
            alert('请求失败');
          }
        });
      });
    });
    </script>
  </head>
  <body>
    <input type="button" value="按钮" id="btn1">
  </body>
</html>
